<!DOCTYPE html>

<html lang="ja">

<head>
  <meta charset="utf-8" />
  <title>lunchbox - order</title>
  <link rel="shortcut icon" href="/favicon.ico" />
  <style><%-css%></style>
  <script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
  <script>
    function submitAction(vl){
      var el = document.getElementById("form"+vl);
      el.submit();
    }
  </script>
</head>

<body>

  <div id="wrap">

<%- header%>

    <div id="content">

<%- sidebar%>

      <div id="main">

        <div>
          <button type="button">前月</button>
          <button type="button">翌月</button>
        </div>

      <table id="order-calendar">
        <tbody>
        <% for (var i in calendar) { %>
        <tr><% for (var j in calendar[i]) { %>
            <td<% if(calendar[i][j].day != 0){ if (j==0) { %> class="order-sun"<% } if (j==6){ %>  class="order-sat"<% }} %>>
              <form id="form<%-calendar[i][j].day%>" action="/orderPPP" method="post" >
                <div name="token" value="<%-calendar[i][j].day%>" onclick="submitAction(<%-calendar[i][j].day%>);" data-day="<%-calendar[i][j].day%>">
                <% if (!calendar[i][j].outrange) { %>
                <%-calendar[i][j].day%>
                <% } %>
    
                  <input type="hidden" name="dayToken" value="<%-calendar[i][j].day%>" />
                  <input type="hidden" name="orderFlg" value="<%-calendar[i][j].orderFlg%>" />
                    <br />
                  <% if (calendar[i][j].orderFlg==1) { %>
                    <img style="width:45pt; height:30pt" src="./img/1.png" />
                  <% }else if (calendar[i][j].orderFlg==2){ %>
                    <img style="width:45pt; height:30pt" src="./img/2.png" />
                  <% }else{ %>
                    <img style="width:45pt; height:30pt" src="./img/3.png" />
                  <% } %>
                </div>
              </form>
            </td><% } %>
        
        </tr>
        <% } %>
        </tbody>
      </table>

      </div>
    </div>

    <footer>
      <p>&copy; 2014 Sorimachi, Inc.</p>
    </footer>

  </div>

</body>

</html>
